<?php
//----------------------------------------------------------------------------//
// File              : V_QuyHoachAdd										  //
// Modification       :														  //
//----------------------------------------------------------------------------//
// Date(yyyy.mm.dd)   Developer                       Action				  //
//----------------------------------------------------------------------------//
// 2007.03.05         Tran Thanh                     Created				  //
//----------------------------------------------------------------------------//
?>

<?php
function V_SanphamAdd(&$arrayData,$mode="View"){
	$ulr = "?".MODUL."=sanpham&curPg=".CM_getParameter("curPg")."&".ACTION."=";
	$ul = "?".MODUL."=catSanpham&".ACTION."=";
	
	$strButtonLabel ="    Save    ";
?>
<?= CM_showError()?>
<?php $id=CM_getParameter("id"); ?>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
 <form enctype="multipart/form-data" action="<?=$ulr?>" method="post" name="frm" id="frm">
    <input type="hidden" name="id" value="<?=CM_getParameter("id");?>" />
        <tr>
          <td width="2%" rowspan="2" valign="top" ><?
          if(($arrayData["anh_sp"])!=""){
		  	$anh_sp=$arrayData['anh_sp'];
			$url_image=DIR_UPLOADFILE_IMAGES.$anh_sp;
            ?>
					<table cellSpacing=0 cellPadding=3 border=0 align=left>
					<tr>
						<td>
							<div align=left>
								<img name='previewField' height=150 width=150 id='previewField' border=0 src="<?=DIR_UPLOADFILE_IMAGES.$anh_sp?>"  
								onLoad="showImage('<?=$url_image?>');" align=left style="padding-right:10px; padding-left:10px;" >
							</div>							
						</td>
					</tr>
					
				</table>
					
			<?
          }
?>		</td>
		
        </tr>
		<tr>
			<td colspan="2" valign="top">
				<table width="100%" border="0" cellpadding="0" cellspacing="3">
					<tr valign="top">
					  <td><font  style="color:#FF0000; font-size:18px; font-weight:bold; "><?=($arrayData["ten_sp"])?> </font></td>
					</tr>
					<tr valign="top">
					  <td><font  style="color:#000000; font-size:12px; font-weight:bold; ">Giá sản phẩm:&nbsp;<?=($arrayData["gia_sp"])?> </font></td>
					</tr>
					<tr>
					  <td><font style="color:#000000; font-size:12px; font-weight:bold; ">Nhà SX:&nbsp;<i><?=$arrayData['nha_sx']?></i> </font></td>
					</tr>
					<tr>
					  <td><font style="color:#000000; font-size:12px; font-weight:bold; ">Bảo hành:&nbsp;<i><?=$arrayData['bao_hanh']?></i> tháng </font></td>
					</tr>
					<tr>
					  <td><font style="color:#000000; font-size:12px; font-weight:bold; ">Trạng thái:&nbsp;<? if($arrayData['trang_thai']==0) echo "Hết hàng"; else echo "Còn hàng";?> </font></td>
					</tr>
				</table>
			</td>
		</tr>
		 
		<tr>
		  <td colspan="3"><?=($arrayData["mo_ta_sp"])?></td>
	    </tr>
		<tr>
		  <td colspan="3"><div align="justify"><table width="100%"  border="0">
              <tr>
                <td><a class="thanh_link1" href="<?="?".MODUL."=sanpham&".ACTION."=Edit"?>&id_loai_sp=<? echo $arrayData['id_loai_sp']?>&id=<? echo $arrayData['id']; ?>&curPg=<?=CM_getParameter("curPg")?>" onclick="return edit('<?php echo $id ;?>','<?=$arrayData['id_loai_sp']?>');"><img   title=Change height=16 alt=Change hspace=2   src="../images/Edit.gif" width=16 border=0>Sửa</a></td>
                <td><div align="right">
				<a class="thanh_link1" href="<?="?".MODUL."=sanpham&".ACTION."=list&id_loai_sp=".$arrayData['id_loai_sp']."&curPg=".CM_getParameter("curPg");?>" onclick="return list('<?php echo $id ;?>','<?=$arrayData['id_loai_sp']?>');">[Trở về]</a></div></td>
              </tr>
            </table></div></td>
	    </tr>
<input type=hidden name="<?=ACTION2?>" value="<?=CM_getParameter(ACTION2)?>"> 
<input type=hidden name="textfield" value="<?=CM_getParameter("textfield")?>"> 
<input type=hidden name="cat_idS" value="<?=CM_getParameter("cat_idS")?>">
<input type=hidden name="id_loai_sp" value="<?=CM_getParameter("id_loai_sp")?>">  
<input type=hidden name="section_idS" value="<?=CM_getParameter("section_idS")?>"> 
<input type=hidden name="showsS" value="<?=CM_getParameter("showsS")?>"> 
<input type=hidden name="curPg" >
</form>
</table>
<script language=javascript>
function edit(id,id_loai_sp){
	var frm  = document.forms["frm"];
	frm.action  = '?'.MODUL.'=sanpham&'.ACTION.'=Edit&id='+id+'&id_loai_sp='+id_loai_sp;
	frm.submit();
	return false;
}
function list(id,id_loai_sp){
	var frm  = document.forms["frm"];
	frm.action  = '?'.MODUL.'=sanpham&'.ACTION.'=list&id='+id+'&id_loai_sp='+id_loai_sp;
	frm.submit();
	return false;
}
//  -----------------End ---------------------------->
</script>
<?php
}
?>
